﻿using UnityEngine;
using UnityEditor;

public class MyWindow : EditorWindow {
	string myString = "Hello World";
	bool groupEnabled;
	bool myBool = true;
	float myFloat = 1.23f;
	MyEnum e;
	[MenuItem("Window/My Window")]
	static void Init()
	{
		EditorWindow.GetWindow(typeof(MyWindow));
	}
	enum MyEnum
	{
		China,
		hello,
		USa,
	};
	void OnGUI()
	{
		GUILayout.Label("Base Setting",EditorStyles.boldLabel);
		myString = EditorGUILayout.TextField("Text Field",myString);
		e = (MyEnum)EditorGUILayout.EnumPopup("MyEnum",e);
		groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Settings",groupEnabled);
		myBool = EditorGUILayout.Toggle("Toggle",myBool);
		myFloat = EditorGUILayout.Slider("Slider",myFloat,-3,3);
		EditorGUILayout.EndToggleGroup();
	}

}
